{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'time' has no attribute 'clock'",
     "output_type": "error",
     "traceback": [
      "\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[1;31mAttributeError\u001B[0m                            Traceback (most recent call last)",
      "Input \u001B[1;32mIn [3]\u001B[0m, in \u001B[0;36m<module>\u001B[1;34m\u001B[0m\n\u001B[0;32m      7\u001B[0m \u001B[38;5;28;01mimport\u001B[39;00m \u001B[38;5;21;01mfunctools\u001B[39;00m\n\u001B[0;32m      8\u001B[0m \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01mstatistics\u001B[39;00m \u001B[38;5;28;01mimport\u001B[39;00m mean, stdev\n\u001B[1;32m---> 10\u001B[0m a \u001B[38;5;241m=\u001B[39m \u001B[43mtime\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mclock\u001B[49m()\n\u001B[0;32m     11\u001B[0m \u001B[38;5;28mprint\u001B[39m(a)\n",
      "\u001B[1;31mAttributeError\u001B[0m: module 'time' has no attribute 'clock'"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import random\n",
    "import time\n",
    "import itertools\n",
    "import urllib\n",
    "import csv\n",
    "import functools\n",
    "from statistics import mean, stdev\n",
    "\n",
    "a = time.clock()\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "def all_tours_tsp(cities):\n",
    "    \"\"\"\n",
    "    Generate all possible tours of the cities and choose the shortest tour.\n",
    "    \"\"\"\n",
    "    return shortest_tour(all_tours_tsp(cities))\n",
    "\n",
    "def shortest_tour(tours):\n",
    "    \"\"\" Choose the tour with the minimum tour length. \"\"\"\n",
    "    return min(tours, key=tour_length)\n",
    "\n",
    "# TO DO: Data types (cities, tours), Functions (all_tours, tour_length)\n",
    "\n",
    "cities = {1, 2, 3}  # a set of city numbers\n",
    "all_tours = itertools.permutations\n",
    "print(list(all_tours(cities)))\n",
    "\n",
    "\n",
    "def tour_length(tour):\n",
    "    return sum(distance())\n",
    "\n",
    "\n",
    "from clockdeco import clock"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}